package com.huage.courseplatform.application.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huage.courseplatform.application.model.entity.Student;
import com.huage.courseplatform.application.model.entity.SysDict;
import com.huage.courseplatform.framework.config.MybatisRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
//@CacheNamespace(implementation= MybatisRedisCache.class,eviction= MybatisRedisCache.class)
public interface StudentMapper extends BaseMapper<Student> {

    List<Student> getByUserId(String userId);

    //中间表hg_user_student
    void addUserStudent(@Param("userId") String userId, @Param("studentId")String studentId);

    void delUserStudent(@Param("userId")String userId, @Param("studentId")String studentId);

    void delUserStudentByStudentId(@Param("studentId") String studentId);

    List<String> getUserIdListByStudentId(String studentId);

    //中间表hg_period_student
    int getCountStudentPeriodById(String studentId);

}
